<template>
  <div id="resources">
    <div class="search">
      <div class="searchname">课程搜索</div>
      <div class="searchbox">
        <Input class="search-input" search enter-button placeholder="Enter something..." @on-click="search" />
      </div>
      <div class="condition">
        <span class="name">综合排序:</span>
        <ul class="order">
          <li :class="{'active':currentIndex===0}" @click="selectItem(0)">按时间降序</li>
          <li :class="{'active':currentIndex===1}" @click="selectItem(1)">按时间升序</li>
          <li :class="{'active':currentIndex===2}" @click="selectItem(2)">按播放次数升序</li>
          <li :class="{'active':currentIndex===3}" @click="selectItem(3)">按播放次数降序</li>
        </ul>
      </div>
    </div>
    <div class="desc">
      <ul class="wrap clearfix">
        <li class="item" v-for="item in 16">
          <div class="video">
            <video src="http://vjs.zencdn.net/v/oceans.mp4"></video>
            <div class="mask">
              <Icon type="md-arrow-dropright-circle" />
            </div>
          </div>
          <div class="videoinfo">
            <div class="line1 clearfix">
              <div class="name">XX综合模拟演练</div>
              <div class="teacher">讲师：张某某</div>
            </div>
            <div class="line2">上课时间：2018年7月10日</div>
          </div>
        </li>
      </ul>
    </div>
    <div class="page">
      <Page :total="100" />
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      currentIndex: -1
    }
  },
  methods: {
    search() {
      console.log('search')
    },
    // 筛选
    selectItem(index) {
      this.currentIndex = index
    }
  }
}
</script>
<style lang="scss">
#resources {
  padding: 40px;
  .search {
    display: flex;
    height: 40px;
    line-height: 40px;
    margin-bottom: 20px;
    .searchname {
      width: 80px;
      height: 32px;
      font-size: 18px;
    }
    .searchbox {
      width: 200px;
      height: 40px;
      font-size: 0;
      .search-input {
        position: relative;
        top: 4px;
      }
    }
    .condition {
      display: flex;
      font-size: 18px;
      height: 40px;
      padding-left: 40px;
      .name {
        padding: 0 10px;
      }
      .order {
        display: flex;
        li {
          padding: 0 10px;
          box-sizing: border-box;
          cursor: pointer;
          &:hover {
            color: #57a3f3;
            border-bottom: 2px solid #57a3f3;
          }
          &.active {
            color: #57a3f3;
            border-bottom: 2px solid #57a3f3;
          }
        }
      }
    }
  }
  .desc {
    width: 100%;
    .wrap {
      width: 100%;
      .item {
        float: left;
        width: 25%;
        padding: 0 10px 20px;
        .video {
          width: 100%;
          height: 180px;
          position: relative;
          video {
            width: 100%;
            height: 100%;
          }
          .mask {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.1);
            font-size: 0;
            .ivu-icon {
              font-size: 30px;
              position: absolute;
              left: 50%;
              top: 50%;
              transform: translateX(-50%) translateY(-50%);
              transition: font-size 0.2s cubic-bezier(0.075, 0.82, 0.165, 1);
              &:hover {
                font-size: 50px;
                color: #2d8cf0;
              }
            }
          }
        }
        .videoinfo {
          padding-top: 10px;
          .line1 {
            font-size: 16px;
            .name {
              float: left;
              font-weight: bold;
            }
            .teacher {
              float: right;
            }
          }
        }
      }
    }
  }
  .page {
    text-align: center;
    padding-top: 40px;
  }
}
</style>

